home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
-
- Dim fso
- Dim ts
- Dim strOPath
- Dim strOExe
- Dim strIndexPath
- Dim strMPlayPath
- Dim strOIni
- Dim strSrcDrv
- Dim strScriptPath
- Dim wshShell
- Dim strIconPath
- Dim objShortcutLnk
- Dim objShell
- Dim strCrs
- Dim objFolder
-
- Const APPLICATION_DATA = 28
- Const FOF_CREATEPROGRESSDLG = &H0&
- Const strReplacePath="C:\Documents and Settings\limited\Local Settings\Application Data\AEMCRS\"
-
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set objShell = CreateObject("Shell.Application")
- Set wshShell = CreateObject("WScript.Shell")
-
- strScriptPath = Wscript.ScriptFullName
- strOPath = objShell.NameSpace(APPLICATION_DATA).Self.Path
- strSrcDrv = fso.GetParentFolderName(strScriptPath)
- strSrcDrv = fso.GetParentFolderName(strSrcDrv)
- strOPath = fso.BuildPath(strOPath, "\AEMCRS")
- strOExe = fso.BuildPath(strOPath, "opera.exe")
- strIndexPath = fso.BuildPath(strSrcDrv, "mm\index.html")
- strMPlayPath = fso.BuildPath(strOPath, "mplayerc.exe")
- strIconPath = fso.BuildPath(strOPath, "cd.ico")
- strOIni = fso.BuildPath(strOPath, "profile\opera6.ini")
-
- Set ts = fso.OpenTextFile(fso.BuildPath(strSrcDrv, "discid.txt"))
- ts.SkipLine
- ts.SkipLine
- strCrs = ts.ReadLine
- ts.Close
-
- If fso.FolderExists(strOPath) Then
- fso.DeleteFolder strOPath, True
- End If
- fso.CreateFolder (strOPath)
-
- Set objFolder = objShell.NameSpace(strOPath)
- objFolder.CopyHere fso.BuildPath(strSrcDrv, "exe\bin\*.*")
-
- Set objShortcutLnk = wshShell.CreateShortcut(fso.BuildPath(wshShell.SpecialFolders("Desktop"), "AEM ") & strCrs & ".lnk")
- objShortcutLnk.TargetPath = strOExe
- objShortcutLnk.Arguments = Chr(34) & strIndexPath & Chr(34)
- objShortcutLnk.WorkingDirectory = strOPath
- objShortcutLnk.IconLocation = strIconPath
-
- objShortcutLnk.Save
-
- If fso.GetFile(strOIni).Attributes And 1 Then
- fso.GetFile(strOIni).Attributes = fso.GetFile(strOIni).Attributes - 1
- End If
-
- Set ts = fso.OpenTextFile(strOIni)
- strCrs = ts.readall
- ts.Close
-
- strCrs=Replace(strCrs,strReplacePath,strOPath & "\",1,-1,1)
-
- Set ts = fso.OpenTextFile(strOIni,2)
- ts.Write strCrs
- ts.Close
-
- MsgBox "A shortcut to the course has been created on your desktop", vbInformation, "AEM Full Course CD"
-